package com.robot.orders.client;

import com.alibaba.fastjson.JSON;
import com.robot.orders.client.impl.AgentClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author lin
 */
@Component
@FeignClient(value = "robot-agent", fallback = AgentClientImpl.class)
public interface AgentClient {
    /**
     * 增加AgentMember
     *
     * @param agentMember
     */
    @RequestMapping(value = "agentMember/third/addAgentMemberByAgentMember", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
    public void thirdAddAgentMemberByAgentMember(@RequestBody String agentMember);

    /**
     * 修改AgentMember
     *
     * @param agentMember
     */
    @RequestMapping(value = "agentMember/third/updateAgentMemberByAgentMember", method = RequestMethod.PUT, produces = "application/json; charset=utf-8")
    public void thirdUpdateAgentMemberByAgentMember(@RequestBody String agentMember);

    /**
     * 删除AgentMember
     *
     * @param id
     */
    @RequestMapping(value = "agentMember/third/deleteAgentMemberById/{id}", method = RequestMethod.DELETE, produces = "application/json; charset=utf-8")
    public void thirdDeleteAgentMemberById(@PathVariable String id);

    /**
     * 通过agentId和memberId查找代理商名下的某一会员
     *
     * @param agentId
     * @param memberId
     * @return
     */
    @RequestMapping(value = "agentMember/third/findAgentMemberByAgentIdAndMemberId/{agentId}/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String thirdFindAgentMemberByAgentIdAndMemberId(@PathVariable String agentId, @PathVariable String memberId);
}
